/*************************************************************************
	> File Name: EP02-2.c
	> Author: 
	> Mail: 
	> Created Time: 
 ************************************************************************/
#include <stdio.h>
#define MAX_N 4000000

int main() {
    int fib[3] = {0, 1, 1}, n = 3, sum = 0;
    while (fib[(n - 2) % 3] + fib[(n - 1) % 3] <= MAX_N) {
        fib[n % 3] = fib[(n - 2) % 3] + fib[(n - 1) % 3];
        if (!(fib[n % 3] & 1)) sum += fib[n % 3];
        n++;
    }
    printf("%d\n", sum);
    return 0;
}
